package com.client.utils; import java.lang.annotation.Annotation; import java.util.Collection; import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; /** * gson */ public class GsonIgnoreStrategy implements ExclusionStrategy { /* * (non-Javadoc) * * @see com.google.gson.ExclusionStrategy#shouldSkipClass(java.lang.Class) */ @Override public boolean shouldSkipClass(Class<?> clazz) { return false; } /* * (non-Javadoc) * * @see com.google.gson.ExclusionStrategy#shouldSkipField(com.google.gson. * FieldAttributes) */ @Override public boolean shouldSkipField(FieldAttributes fieldAttributes) { Collection<Annotation> annotations = fieldAttributes.getAnnotations(); for (Annotation annotation : annotations) { if (annotation.annotationType() == GsonIgnore.class) { return true; } } return false; } }
最近下载更多
amayaT LV5
4月23日
ewan007 LV29
3月4日
Lyj 329511 LV4
2023年10月11日
348835269 LV11
2023年9月26日
dzlwindy LV8
2023年7月12日
小屁孩 LV7
2023年6月2日
ericxu1116 LV24
2023年5月28日
高腾达 LV3
2023年5月26日
xiaoliangPIp LV3
2023年4月27日
sunlzh888888 LV28
2023年4月26日